package com.tjsinfo.tjsoa.vote.bo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.vote.dao.ITVoteEstimatedStatusDAO;
import com.tjsinfo.tjsoa.vote.vo.TVoteEstimatedStatus;

public class TVoteEstimatedStatusBO implements ITVoteEstimatedStatusBO {
	
	private IQbcDao qbcDao;	
	private ITVoteEstimatedStatusDAO estimatedStatusDao;
	
	public IQbcDao getQbcDao() {
		return qbcDao;
	}
	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}
	public ITVoteEstimatedStatusDAO getEstimatedStatusDao() {
		return estimatedStatusDao;
	}
	public void setEstimatedStatusDao(ITVoteEstimatedStatusDAO estimatedStatusDao) {
		this.estimatedStatusDao = estimatedStatusDao;
	}
	
	public void save(TVoteEstimatedStatus transientInstance) {
		// TODO Auto-generated method stub
		estimatedStatusDao.save(transientInstance);
	}

	public List findStatus(String headId){
		DetachedCriteria criteria = DetachedCriteria.forClass(TVoteEstimatedStatus.class);
		criteria.add(Restrictions.eq("headId", headId));
		criteria.add(Restrictions.eq("status", 0));
		List list = qbcDao.getCriteria(criteria);
		return list;
	}
	public TVoteEstimatedStatus findById(String id) {
		// TODO Auto-generated method stub
		return estimatedStatusDao.findById(id);
	}
	public void update(TVoteEstimatedStatus transientInstance) {
		// TODO Auto-generated method stub
		estimatedStatusDao.update(transientInstance);
	}

}
